//
//  CSBELUASweeping.swift
//  CurSodoboAer
//
//  Created by CurSodoboAer on 2024/11/5.
//

import UIKit

class CSBELUASweeping: UIViewController {
    @IBOutlet weak var elsititgjkhTitlecsb: UILabel!
    
    @IBOutlet weak var miuContentElua: UITextView!
    
    @IBOutlet weak var termgVSB: UIButton!
    
    @IBOutlet weak var priCSB: UIButton!
    
    @IBOutlet weak var qucanceCSB: UIButton!
    var titlkiCSB:Int = 0
    var myAgreenClosure: (() -> Void)?
    
    var csbColoter:UIColor = .brown
    var csbFplowe:CGFloat = 23.1
    var csbHeihei:UIFont?
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        if csbColoter == UIColor.black {
            csbHeihei = UIFont.systemFont(ofSize: csbFplowe)
            self.view.backgroundColor = csbColoter
        }else{
            csbHeihei = UIFont.systemFont(ofSize: csbFplowe + 1)
        }
        guard let newrFong = csbHeihei else { return  }

        if self.view.backgroundColor == csbColoter {
            var qurk = UIButton(configuration: UIButton.Configuration.plain())
            qurk.isHidden = true
            qurk.isEnabled = false
            view.addSubview(qurk)
        }
        
        if titlkiCSB == 1 {
            elsititgjkhTitlecsb.text = "Privacy Policy for Livhup"
            miuContentElua.text = """
Livhup, the vibrant social app for curling enthusiasts, values your privacy and is committed to protecting your personal information. This Privacy Policy outlines how we collect, use, and disclose your personal data when you use our app.

1. Collection of Information
We may collect personal information such as your name, email address, location, and curling preferences. We also collect non-personal information like app usage data and device information to improve our services.

2. Use of Information
We use your personal information to provide you with a personalized curling experience, including recommending events, clubs, and training plans. We may also use your information for marketing purposes, such as sending you notifications about new features or events.

3. Disclosure of Information
We will not disclose your personal information to third parties without your consent, except as required by law or to provide you with our services. We may share anonymized or aggregated data with third parties for research or analytical purposes.

4. Security of Information
We take reasonable steps to protect your personal information from unauthorized access, use, or disclosure. However, no method of transmission over the internet or method of electronic storage is 100% secure, and we cannot guarantee its absolute security.

5. Your Rights
You have the right to access, correct, and delete your personal information. You can exercise these rights by contacting us through our app or website.
By using Livhup, you agree to our Privacy Policy and our Terms of Service. We reserve the right to update this Privacy Policy from time to time. Please review it regularly for updates.
Thank you for choosing Livhup! Start your unforgettable curling journey today.

"""
            termgVSB.isHidden = true
            
            priCSB.isHidden = true
            qucanceCSB.isHidden = true
            
        }else if titlkiCSB == 2{
            
            elsititgjkhTitlecsb.text = "Terms of Service for Livhup"
            miuContentElua.text = """
Welcome to Livhup, the social app designed for curling enthusiasts! By using our app, you agree to the following terms of service:

Account Usage: You must create an account to use Livhup. You are responsible for maintaining the security of your account and password. You may not use the app for any illegal or unauthorized purposes.

Content and Conduct: You agree to post only appropriate and relevant content on Livhup. This includes respecting the rights of others, not posting harmful or offensive material, and complying with all applicable laws.

Event Participation: When participating in curling events or gatherings through Livhup, you are responsible for your own safety and conduct. We are not liable for any injuries or damages that may occur.

AI Curling Coach: Our AI curling coach provides personalized advice and training plans. However, we are not responsible for any injuries or losses that may result from following its recommendations.

Privacy: We respect your privacy and will handle your personal information in accordance with our Privacy Policy. By using Livhup, you agree to our privacy practices.

Termination: We may terminate your account at any time for any reason, including but not limited to violating these terms of service.

By downloading and using Livhup, you agree to be bound by these terms of service. We reserve the right to update these terms from time to time. Please review them regularly for updates.

Start your unforgettable curling journey with Livhup today!

"""
            termgVSB.isHidden = true
            qucanceCSB.isHidden = true
            priCSB.isHidden = true
        }
        
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        var ikol = ["csbFplowe":csbFplowe]
        if self.view.backgroundColor == .brown {
            ikol["allElseTigerCSB"]  = 77.8
            csbFplowe += 1.1
        }else{
            csbFplowe += 2.1
        }

        if csbFplowe < 10{
            return
        }
        miuContentElua.layer.cornerRadius = 12
        miuContentElua.layer.masksToBounds = true
        
        
    }


    @IBAction func tetmgToNow(_ sender: Any) {
        let gitj = CSBELUASweeping.init()
        gitj.titlkiCSB = 2
        var ikol = ["csbFplowe":csbFplowe]
        if self.view.backgroundColor == .brown {
            ikol["allElseTigerCSB"]  = 77.8
            csbFplowe += 1.1
        }else{
            csbFplowe += 2.1
        }

        if csbFplowe < 10{
            return
        }
        self.navigationController?.pushViewController(gitj, animated: true)
    }
   

    @IBAction func privacytonow(_ sender: Any) {
        let gitj = CSBELUASweeping.init()
        gitj.titlkiCSB = 1
        var ikol = ["csbFplowe":csbFplowe]
        if self.view.backgroundColor == .brown {
            ikol["allElseTigerCSB"]  = 77.8
            csbFplowe += 1.1
        }else{
            csbFplowe += 2.1
        }

        if csbFplowe < 10{
            return
        }
        self.navigationController?.pushViewController(gitj, animated: true)
    }
    
    
    @IBAction func surenorNOCSB(_ sender: Any) {
        var ikol = ["csbFplowe":csbFplowe]
        if self.view.backgroundColor == .brown {
            ikol["allElseTigerCSB"]  = 77.8
            csbFplowe += 1.1
        }else{
            csbFplowe += 2.1
        }

        if csbFplowe < 10{
            return
        }
        if titlkiCSB == 0 {
            AppDelegate.comeOKAUCSBELUA = true
            if myAgreenClosure != nil{
                myAgreenClosure!()
            }
            self.dismiss(animated: true)
        }else{
            
            self.navigationController?.popViewController(animated: true)
        }
       
    }
    
    
    
    @IBAction func cangNUotingCSB(_ sender: Any) {
        var ikol = ["csbFplowe":csbFplowe]
        if self.view.backgroundColor == .brown {
            ikol["allElseTigerCSB"]  = 77.8
            csbFplowe += 1.1
        }else{
            csbFplowe += 2.1
        }

        if csbFplowe < 10{
            return
        }
        if titlkiCSB == 0 {
            self.dismiss(animated: true)
            return
        }
        self.navigationController?.popViewController(animated: true)
    }
    
    
    
    
}
